home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / patchlist / patchlist.c < prev    next >
C/C++ Source or Header  |  1995-09-01  |  2KB  |  72 lines

  1. #include <stdio.h>
  2. #include <exec/types.h>
  3. #include <exec/libraries.h>
  4. #include "ASMSources:PatchLibrary/PatchInclude/patch_protos.h"
  5. #include "ASMSources:PatchLibrary/PatchInclude/patch.h"
  6. #include "ASMSources:PatchLibrary/PatchInclude/patchtags.h"
  7.  
  8. char *ver="$VER: PatchList 1.51 (01.11.93)  by Stefan Fuchs";
  9. struct PatchBase *patchBase;
  10.  
  11. void Open_All();
  12. void Close_All();
  13.  
  14.  
  15. void main()
  16. {
  17. struct MasterPatch *MPatchPointer;
  18. struct Patch *PatchPointer;
  19.  
  20.     printf("PatchList V1.51  © 1993 by Stefan Fuchs\n");
  21.     printf("LIBRARY:                  LVO:  PRI: TYPE:  NAME:\n");
  22.  
  23.     Open_All();
  24.  
  25.     for (MPatchPointer = (struct MasterPatch *)patchBase->PB_MasterPatchHeader.lh_Head;
  26.          MPatchPointer->MPS_Node.ln_Succ;
  27.          MPatchPointer = (struct MasterPatch *)MPatchPointer->MPS_Node.ln_Succ)
  28.     {
  29.         if (MPatchPointer->MPS_Node.ln_Type == PS_TYPE_MASTER)
  30.         {
  31.             for (PatchPointer = (struct Patch *)MPatchPointer->MPS_PatchHeader.mlh_Head;
  32.                  PatchPointer->PS_Node.ln_Succ;
  33.                    PatchPointer = (struct Patch *)PatchPointer->PS_Node.ln_Succ)
  34.             {
  35.                 if ((PatchPointer->PS_Node.ln_Type == PS_TYPE_USER) || (PatchPointer->PS_Node.ln_Type == PS_TYPE_SYSTEM))
  36.                 {
  37.                     printf("%-25s",MPatchPointer->MPS_PatchedLibraryBase->lib_Node.ln_Name);
  38.                     printf(" $%4X %4d ",MPatchPointer->MPS_PatchedLVO,PatchPointer->PS_Node.ln_Pri);
  39.                     if (PatchPointer->PS_Node.ln_Type == PS_TYPE_USER) printf("USER   ");
  40.                     else                                               printf("SYSTEM ");
  41.                     if (PatchPointer->PS_Node.ln_Name)
  42.                         printf("%s\n",PatchPointer->PS_Node.ln_Name);
  43.                     else
  44.                         printf("<unnamed>\n");
  45.                 }
  46.  
  47.             }
  48.         }
  49.     }
  50.  
  51.     Close_All("");
  52. }
  53.  
  54. void Open_All()
  55. {
  56.     if((patchBase = (struct PatchBase *) OpenLibrary(PatchName, 2)) == NULL)
  57.         Close_All("Can't open V2+ patch.library !\n");
  58.     ObtainSemaphore(&patchBase->PB_Semaphore);
  59. }
  60.  
  61. void Close_All(s)
  62. char *s;
  63. {
  64.     printf("%s",s);
  65.     if(patchBase)
  66.     {
  67.         ReleaseSemaphore(&patchBase->PB_Semaphore);
  68.         CloseLibrary(patchBase);
  69.     }
  70.     exit(TRUE);
  71. }
  72.